//
//  HeroModel.m
//  MyDota
//
//  Created by 濮亚军 on 15/12/3.
//  Copyright © 2015年 濮亚军. All rights reserved.
//

#import "HeroModel.h"

@implementation HeroModel
#pragma mark ------重写init方法------
-(instancetype)initWitnBmobObject:(BmobObject *)obj
{
    self = [super init];
    if (self)
    {
        self.heroName = [obj objectForKey:@"HeroName"];
        BmobFile *file = [obj objectForKey:@"HeroIcon"];
        self.heroIcon = file.url;
        self.positionArray = [obj objectForKey:@"Position"];
        self.heroType = [obj objectForKey:@"Type"];
        self.heroHP = [obj objectForKey:@"HP"];
        self.heroMP = [obj objectForKey:@"MP"];
        self.heroCamp = [obj objectForKey:@"Camp"];
        self.heroArmor = [[obj objectForKey:@"Armor"] floatValue];
        self.heroATK = [obj objectForKey:@"ATK"];
        self.heroAveATK = [[obj objectForKey:@"aveATK"] floatValue];
        self.heroASPD = [[obj objectForKey:@"ASPD"] integerValue];
        self.heroSpeed = [[obj objectForKey:@"Speed"] integerValue];
        self.heroStrength = [[obj objectForKey:@"Strength"] floatValue];
        self.heroDexterity = [[obj objectForKey:@"Dexterity"] floatValue];
        self.heroIntelligence = [[obj objectForKey:@"Intelligence"] floatValue];
        self.heroStrikingDistance = [[obj objectForKey:@"StrikingDistance"] integerValue];
        self.heroAddSt = [[obj objectForKey:@"AddSt"] floatValue];
        self.heroAddDe = [[obj objectForKey:@"AddDe"] floatValue];
        self.heroAddIn = [[obj objectForKey:@"AddIn"] floatValue];
        self.heroHorizon = [obj objectForKey:@"Horizon"];
        
        BmobFile *skillOne = [obj objectForKey:@"SkillOneIcon"];
        self.heroSkillOneIcon = skillOne.url;
        self.heroSkillOneName = [obj objectForKey:@"SkillOneName"];
        
        BmobFile *skillTwo = [obj objectForKey:@"SkillTwoIcon"];
        self.heroSkillTwoIcon = skillTwo.url;
        self.heroSkillTwoName = [obj objectForKey:@"SkillTwoName"];
        
        BmobFile *skillThree = [obj objectForKey:@"SkillThreeIcon"];
        self.heroSkillThreeIcon = skillThree.url;
        self.heroSkillThreeName = [obj objectForKey:@"SkillThreeName"];
        
        BmobFile *skillFour = [obj objectForKey:@"SkillFourIcon"];
        self.heroSkillFourIcon = skillFour.url;
        self.heroSkillFourName = [obj objectForKey:@"SkillFourName"];
    }
    return self;
}
@end
